#include "esp_timer.h"
#include "esp_log.h"
#include "system.h"

static const char* TAG = "MY_TIMER";

static esp_timer_handle_t my_timer;

void timer_callback(void* arg) {
    printInfo();
}

void init_timers(){
    // 创建一个定时器
    esp_timer_create_args_t timer_args = {
        .callback = &timer_callback,
        .name = "my_timer"
    };
    ESP_ERROR_CHECK(esp_timer_create(&timer_args, &my_timer));
    ESP_ERROR_CHECK(esp_timer_start_periodic(my_timer, 10 * 1000000));  // 5秒
}